<?php

namespace Admin\Controller;
//use Think\Controller;
use Tools\AdminController;
class OrderController extends AdminController{
   function showlist(){
       $order = D('Order');
       if($_GET['order_id']){
        $order_id =  $_GET['order_id'];
       $info = $order->where("order_id = $order_id")->save(array('order_status'=>2));
       $this->redirect('showlist'); 
       }
       $info = $order->select();
       $this->assign('info',$info);
       $this->display();
   }
   function detail($order_id){
       $cat = D('Cat');
       $info = $cat->where("order_id=$order_id")->select();
       $price = $cat->field('sum(c_price)')->where("order_id = $order_id and c_status = 1")->find();
       $this->assign('price',$price);
       $this->assign('info',$info);
       $this->display();
   }
}
